package com.pks.datacenter.config;

import java.io.File;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "myconfig",ignoreInvalidFields = false )
public class MyConfig {

	public static String contextPath;
	public static String savePath;

	/** 保存下载文件的文件夹 */
	public static final String FOLDER_DOWNLOAD = "download";
	/** 保存上传文件的文件夹 */
	public static final String FOLDER_UPLOAD = "upload";
	/** 登录页的请求相对地址 */
	public static final String URL_LOGIN = "/index/tologin";

	public static Long moduleId;
	
	public static String yun_api_url;
	public static String yun_api_account;
	public static String yun_api_password; 
	
	
	public void setContextPath(String contextPath) {
		MyConfig.contextPath = contextPath;  
	}

	public void setSavePath(String savePath) {
		if (!savePath.endsWith(File.separator)) {
			savePath += File.separator;
		} 
		MyConfig.savePath = savePath;
	}

	public static String getContextPath() {
		return contextPath;
	}

	public static String getSavePath() {
		return savePath;
	}

	public static Long getModuleId() {
		return moduleId;
	}

	public void setModuleId(Long moduleId) {
		MyConfig.moduleId = moduleId;
	}

	public static String getYun_api_url() {
		return yun_api_url;
	}

	public void setYun_api_url(String yun_api_url) {
		MyConfig.yun_api_url = yun_api_url;
	}

	public static String getYun_api_account() {
		return yun_api_account;
	}

	public void setYun_api_account(String yun_api_account) {
		MyConfig.yun_api_account = yun_api_account;
	}

	public static String getYun_api_password() {
		return yun_api_password;
	}

	public void setYun_api_password(String yun_api_password) {
		MyConfig.yun_api_password = yun_api_password;
	}
	
}
